<template>
	<view class="wallet-balance">
		<!-- 顶部蓝色渐变背景 -->
		<view class="balance-header">
			<view class="balance-amount">
				<view class="amount-label">￥</view>
				<view class="amount-value">0.00</view>
				<u-icon name="info-circle" size="24" color="#fff" class="amount-info"></u-icon>
			</view>
			<view class="balance-actions">
				<view class="action-btn" @tap="goDetail">交易明细</view>
			</view>
		</view>

		<!-- 联盟充值卡片 -->
		<view class="recharge-card">
			<view class="recharge-title">联盟充值</view>
			<view class="recharge-content">
				<view class="recharge-item">
					<view class="recharge-amount">￥0.00</view>
					<view class="recharge-label">充值本金</view>
				</view>
				<view class="recharge-item">
					<view class="recharge-amount">￥0.00</view>
					<view class="recharge-label">充值赠送</view>
				</view>
			</view>
		</view>

		<!-- 底部广告 -->
		<view class="wallet-banner" @click="goRecharge">
			<image src="https://img.zcool.cn/community/01b2b95e6e2e2fa801216518a2e2e2.jpg" mode="widthFix"></image>
			<view class="banner-text">
				<text class="banner-title">联盟充值</text>
				<text class="banner-desc">全国联盟充值店铺通用</text>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		methods: {
			goDetail() {
				uni.navigateTo({
					url: '/pages/wallet/record'
				})
			},
			goRecharge() {
				uni.navigateTo({
					url: '/pages/wallet/recharge'
				})
			}
		}
	}
</script>

<style lang="scss">
	.wallet-balance {
		min-height: 100vh;
		background: #f8f8f8;

		.balance-header {
			background: linear-gradient(180deg, #3a6ff7 0%, #5a9cf8 100%);
			border-radius: 0 0 24rpx 24rpx;
			padding-bottom: 40rpx;

			.balance-amount {
				display: flex;
				align-items: flex-end;
				justify-content: center;
				padding-top: 40rpx;

				.amount-label {
					color: #fff;
					font-size: 40rpx;
					margin-right: 8rpx;
				}

				.amount-value {
					color: #fff;
					font-size: 60rpx;
					font-weight: bold;
				}

				.amount-info {
					margin-left: 8rpx;
				}
			}

			.balance-actions {
				display: flex;
				justify-content: flex-end;
				margin: 16rpx 40rpx 0 0;

				.action-btn {
					color: #fff;
					font-size: 28rpx;
					padding: 8rpx 24rpx;
					border-radius: 32rpx;
					background: rgba(255, 255, 255, 0.15);
				}
			}
		}

		.recharge-card {
			background: #fff;
			border-radius: 16rpx;
			margin: -40rpx 24rpx 0 24rpx;
			box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.06);
			padding-bottom: 24rpx;

			.recharge-title {
				text-align: center;
				font-size: 32rpx;
				font-weight: bold;
				color: #5a6ff8;
				padding: 24rpx 0 16rpx 0;
			}

			.recharge-content {
				display: flex;
				justify-content: space-around;

				.recharge-item {
					text-align: center;

					.recharge-amount {
						font-size: 36rpx;
						color: #222;
						font-weight: bold;
					}

					.recharge-label {
						font-size: 26rpx;
						color: #b0b0b0;
						margin-top: 8rpx;
					}
				}
			}
		}

		.wallet-banner {
			margin: 60rpx 24rpx 0 24rpx;
			border-radius: 16rpx;
			overflow: hidden;
			position: relative;

			image {
				width: 100%;
				display: block;
			}

			.banner-text {
				position: absolute;
				left: 40rpx;
				bottom: 40rpx;
				color: #fff;

				.banner-title {
					font-size: 36rpx;
					font-weight: bold;
				}

				.banner-desc {
					font-size: 28rpx;
					margin-top: 8rpx;
					display: block;
				}
			}
		}
	}
</style>